/*
pku2352
author : tang qiao @BNU
数状树组 
*/

#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;

typedef struct {
    int x, y;
}Tpoint;    
Tpoint p[15002];
int v[32002];
int ans[32002];
int n, maxx;

void init() {
    int i;
    maxx = 0;
    for (i=0; i<n; ++i) {
        scanf("%d%d", &p[i].x, &p[i].y);
        p[i].x++;
        p[i].y++;
        maxx >?= p[i].x; // maxx = maxx>p[i].x ? maxx : p[i].x;
    }    
}    
bool comp(const Tpoint &a, const Tpoint &b) {
    if (a.y != b.y) return a.y < b.y;
    return a.x < b.x;
}    
inline int lowbit(int x){
	return x&(-x);
}

void add(int r) {
    while (r<=maxx) {
        v[r] ++;
        r += lowbit(r);
    }    
}
int sum(int r) {
    int s=0;
    while (r>0) {
        s += v[r];
        r -= lowbit(r);
    }    
    if (r>=0) s += v[0];
    return s;
}        
void deal() {
    int i, j;
    memset(v, 0, sizeof(v));
    memset(ans, 0, sizeof(ans));
    sort(p, p+n, comp);
    for (i=0; i<n; ++i) {
        add(p[i].x);
        j = sum(p[i].x)-1;
        ans[j]++;
    }    
    // output
    for (i=0; i<n; ++i)
        printf("%d\n", ans[i]);
}    
int main() 
{
    while (scanf("%d", &n)!=EOF) {
        init();
        deal();
    }    
    return 0;
}    